<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>高铁订票系统后台管理</title>
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <script src="js/jquery-3.6.0.min.js"></script>
    <script>
        function init() {
            // 请求session中admin
            $.get("admin/getInfoBySession", function (data) {
                /* 在标签后面追加文本 */
                $("#helloAdmin").append('你好，' + data.adminName);
            });
        }

        /* 更新子页面 */
        function changeIframe(title) {
            let url = ""
            switch (title) {
                case 'table':
                    url = "table.html";
                    break;
                case 'bie':
                    url = "bie.html";
                    break;
                case 'line':
                    url = "line.html";
                    break;
                case 'root_table':
                    url = "admin_table.html";
                    break;
                case 'admin_update':
                    url = "admin_update.html";
                    break;
                case 'timetable':
                    url = "timetable.html";
                    break;
                case 'stationName':
                    url = "station.html";
                    break;
                case 'user':
                    url = "user.html";
                    break;
                case 'timetable_update':
                    url = "timetable_update.html";
                    break;
                case 'timetable_add':
                    url = "timetable_add.html";
                    break;
                case 'user_update':
                    url = "user_update.html";
                    break;
            }
            $('iframe').attr('src', url);
        }
    </script>

    <script src="layui/layui.js"></script>
    <script>
        //JavaScript代码区域
        layui.use('element', function () {
            var element = layui.element;

            init();
        });
    </script>

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">高铁订票系统后台管理</div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;" id="helloAdmin">
                    <img src="images/admin_login_background.jpg" class="layui-nav-img">
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;" onclick="changeIframe('admin_update')">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="admin/admin_logout">退出系统</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="test">

                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">车票管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="changeIframe('table')" class="layui-this">车票信息</a></dd>
                        <dd><a href="javascript:;" onclick="changeIframe('bie')">车票分类</a></dd>
                        <dd><a href="javascript:;" onclick="changeIframe('line')">车站数据</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="changeIframe('user')">用户信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">列车信息管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="changeIframe('stationName')">车站信息</a></dd>
                        <dd><a href="javascript:;" onclick="changeIframe('timetable')">列车时刻表</a></dd>
                        <dd><a href="javascript:;">列车晚点信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a onclick="changeIframe('root_table')">管理员信息</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <iframe src="timetable.html" frameborder="0" id="demoAdmin" style="width: 100%; height: 810px"
                    scrolling="no"></iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © occgmat.com
    </div>
</div>
</body>
</html>
